﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.QualityContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.QualityContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.QualityContext
{
    /// <summary>
    /// 质量检查明细仓储实现
    /// </summary>
    public class QualityInspectionDetailRepository : EFEntityRepositoryProvider<QualityInspectionDetail>, IQualityInspectionDetailRepository
    {
        #region # 获取质量检查明细列表 —— ICollection<QualityInspectionDetail> Find(Guid qualityInspectionId)
        /// <summary>
        /// 获取质量检查明细列表
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        /// <returns>质量检查明细列表</returns>
        public ICollection<QualityInspectionDetail> Find(Guid qualityInspectionId)
        {
            IQueryable<QualityInspectionDetail> details = base.Find(x => x.QualityInspection.Id == qualityInspectionId);

            return details.ToList();
        }
        #endregion
    }
}
